package com.first.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class EchartsDate implements Serializable {
    private String  name;
    private  int  value;

    public List<EchartsDate> setEcharts(List<List> lists){
        ArrayList<EchartsDate> echartss = new ArrayList<>();
        for (List list : lists) {
            EchartsDate echarts = new EchartsDate();
            echarts.setName(list.get(0).toString());
            echarts.setValue(Integer.parseInt(list.get(1).toString()));
            echartss.add(echarts);
        }
        return echartss;
    }

}
